package cn.initcap.designpattern.pattern.structural.proxy.db;

/**
 * @author initcap
 * @date Created in 2018/9/18 AM8:54.
 */
public class DataSourceContextHolder {
    private static final ThreadLocal<String> CONTEXT_HOLDER = new ThreadLocal<String>();

    public static String getDataBaseType() {
        return CONTEXT_HOLDER.get();
    }

    public static void setDataBaseType(String dbType) {
        CONTEXT_HOLDER.set(dbType);
    }

    public static void clearDataBaseType() {
        CONTEXT_HOLDER.remove();
    }
}
